package com.cby.operation.common.widget.floatview

import android.view.View

/**
 * author : Android 轮子哥
 * github : https://github.com/getActivity/XToast
 * time   : 2019/01/04
 * desc   : [View.OnClickListener] 包装类
 */
internal class ViewClickWrapper<T: View>(
    private val floatView: HykbFloatView,
    view: View,
    private val mListener: OnClickListener<T>
) : View.OnClickListener {
    override fun onClick(v: View) {
        mListener.onClick(floatView,  v as T)
    }

    init {
        view.setOnClickListener(this)
    }
}